package com.base.cn.platform.os.service.manage.join;


import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 角色与专业的关联接口
 *
 * @author s.li
 * @create 2018-03-21 14:30
 */
@FeignClient(name = BaseService.appName,configuration = FeignAuthConfig.class)
public interface RoleSubjectService extends BaseService {

    /**
     * 获取角色关联的专业列表数据
     * @param roleId 角色ID
     * @return 数据列表
     */
    @RequestMapping(contextPath+"/findRoleSubjectList")
    List<Map<String,Object>> findRoleSubjectList(@RequestParam("roleId") BigDecimal roleId);

    /**
     * 管理用户登录成功后台缓存用户的专业权限
     * @param sin 登录KEY
     * @param userId 登录的用户ID
     */
    @RequestMapping(contextPath + "/cacheSysUserSubjectData")
    void cacheSysUserSubjectData(@RequestParam(value = "sin", required = false, defaultValue = "") String sin,
                                 @RequestParam(value = "userId", required = false, defaultValue = "0") BigDecimal userId);
}
